home *** CD-ROM | disk | FTP | other *** search
- Path: geraldo.cc.utexas.edu!usenet
- From: wharris@mail.utexas.edu (W. Harris)
- Newsgroups: comp.lang.c++
- Subject: passing struct to constructor - temp.txt [1/1]
- Date: 1 Feb 1996 13:56:19 GMT
- Organization: The University of Texas at Austin
- Message-ID: <4eqgq3$5g1@geraldo.cc.utexas.edu>
- NNTP-Posting-Host: slip-26-1.ots.utexas.edu
- Mime-Version: 1.0
- Content-Type: Text/Plain
- X-Newsreader: WinVN 0.90.4
-
- The compiler error I'm getting is "VIN is not a member of struct1". The
- code has been severely minimized, however this should have the bare
- essentials required to solve the problem.
-
- class CarData
- {
- private :
-
- char VIN[7];
-
- public :
-
- CarData(struct astruct1 CarInf);
-
- };
- //********************************************************
-
- CarData::CarData(struct astruct1 CarInf)
- {
- strcpy(VIN,CarInf.VIN);
- }
-
- struct astruct1
- {
- char VIN[7];
- }CarInfo;
-
- void main()
- {
-
- CarData CarConst1(struct astruct1 CarInfo);
- }
-